From a4763b0782f4c0445ff58c2e66f6bec22ed97f0b Mon Sep 17 00:00:00 2001 From: Maximilian Engelhardt Date: Mon, 7 Dec 2020 23:54:16 +0100 Subject: [PATCH] d/xen-hypervisor-V-F.postinst.vsn-in: use reboot-required When updating the xen hypervisor, touch the /run/reboot-required file to indicate a reboot is required. Also add information about the package requesting the reboot to the /run/reboot-required.pkgs file. Closes: #862408 Signed-off-by: Maximilian Engelhardt Reviewed-by: Hans van Kranenburg --- debian/xen-hypervisor-V-F.postinst.vsn-in | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/debian/xen-hypervisor-V-F.postinst.vsn-in b/debian/xen-hypervisor-V-F.postinst.vsn-in index 1540842eec..623637b057 100644 --- a/debian/xen-hypervisor-V-F.postinst.vsn-in +++ b/debian/xen-hypervisor-V-F.postinst.vsn-in @@ -7,6 +7,20 @@ case "$1" in if command -v update-grub > /dev/null && [ -d /boot/grub ]; then update-grub || : fi + + # create or update /run/reboot-required{,.pkgs} if xen hypervisor is + # running + if [ -e "/sys/hypervisor/type" ]; then + type="$(cat /sys/hypervisor/type)" + if [ "$type" = xen ]; then + if [ -d /run ]; then + touch /run/reboot-required + if ! grep -q "^$DPKG_MAINTSCRIPT_PACKAGE$" /run/reboot-required.pkgs 2> /dev/null ; then + echo "$DPKG_MAINTSCRIPT_PACKAGE" >> /run/reboot-required.pkgs + fi + fi + fi + fi ;; abort-upgrade|abort-remove|abort-deconfigure) -- 2.30.2